package hushi.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

/**
 * RequestPqram(value = "xxx",required = fasle/ture,defaultValue = "自己写的默认值")【数据类型】 名称
 * 说明：指定请求参数的名称
 */

@Controller
@RequestMapping("user")
public class RequestParamTest {
    @RequestMapping("/*")
    public ModelAndView doSearch(String name, String tel,
                                 @RequestParam(value = "eamil",required = false)String eamil,
                                 @RequestParam(value = "userage",required = false,defaultValue = "20")int age){
        System.out.println("param:"+name+" ,"+tel+" ,"+eamil+" ,"+age);
        return new ModelAndView("/search.jsp");
    }
}
